package com.smart.manager.member.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.smart.common.entities.ajax.AjaxResult;
import com.smart.common.entities.constant.SmartConstant;
import com.smart.common.entities.core.Page;
import com.smart.manager.member.entities.bodys.RMemberProfileAddress;
import com.smart.manager.member.entities.models.MemberProfileAddress;
import com.smart.manager.member.repository.MemberProfileAddressRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author Administrator
 */

@Api(tags = "会员地址")
@RestController
@RequestMapping(SmartConstant.MANAGER_API_PREFIX + "member/profile/address")
@RequiredArgsConstructor
public class ProfileAddressApi {

    private final MemberProfileAddressRepository memberAddressRepository;


    @GetMapping(value = "pageList")
    @ApiOperation(value = "查询地址")
    @SaCheckPermission("member:profile:address:pageList")
    public AjaxResult<Page<MemberProfileAddress>> pageList(@Validated RMemberProfileAddress.SearchBody body) {
        Page<MemberProfileAddress> result = memberAddressRepository.pageList(body);
        return AjaxResult.data(result);
    }


}
